/*
 * IMessageCenterModel.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.response.UnReadMessageResponse;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/**
 * 消息中心Model
 */
public interface IMessageModel {

    interface OnAccessListener<T> {

        void onSuccess(T t);
    }

    interface OnOperateListener {

        void onSuccess();

        void onFailed();
    }

    interface OnGetFromNetListener {

        void onSuccess(List<DisplayListItem> displayListItems, boolean empty, boolean hasMore);

        void onFailed();

        void onFinal();
    }

    interface OnGetEnrollMessagesListener {

        void onSuccess(List<Object> messages, boolean empty, boolean hasMore);

        void onFailed();

        void onFinal();

    }

    interface OnGetUnReadMessageCountListener {

        void onSuccess(UnReadMessageResponse.UnReadMessage unReadMessage);

        void onFailed();
    }

    void getUnMessageCountFromServer(String tag, OnGetUnReadMessageCountListener listener);

    /**
     * 物流通知
     */
    void loadLogisticsMessages(boolean isRefreshing, String tag, OnGetFromNetListener listener);

    /**
     * 资产通知消息
     */
    void loadAssetMessages(boolean isRefreshing, String tag, OnGetFromNetListener listener);

    /**
     * 系统消息
     */
    void loadSystemMessages(boolean isRefreshing, String tag, OnGetFromNetListener listener);

    /**
     * 优惠促销消息
     */
    void loadFavourableMessages(boolean isRefreshing, String tag, OnGetFromNetListener listener);

    /**
     * 发现页报名消息
     */
    void loadDiscoveryMessages(boolean isRefreshing, String tag, OnGetEnrollMessagesListener listener);

    /**
     * 设置消息已读
     *
     * @param messageId 消息id
     */
    void setMessageIsRead(String tag, String messageId, OnOperateListener listener);


}
